#include<iostream>
#include<algorithm>
using namespace std;
int fun(int n)
{
	int count = 1;
	while (n != 1) {
		if (n % 2 == 1) {
			n = 3 * n + 1;
		}
		else {
			n /= 2;
		}
		count++;
	}
	return count;
}
int n, m;
int main()
{
	int count = 0;
	while (cin >> n >> m) {
		int k = n;
		int j = m;
		if (n > m) {
			swap(n, m);
		}
		int Max = -30;
		for (int i = n; i <= m; i++) {
			count = fun(i);
			if (count > Max) {
				Max = count;
			}
		}
		cout << k << " " << j << " " << Max << endl;
	}
	return 0;
}